<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <script>
      let nums = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, "J", "Q", "K"]; // 0-12
      // let nums = [6, 9, 3, 4, 5, 1, 7, 8, 2, 10, "J", "Q", "K"]; // 1-12

      function random(min, max) {
        const r = (max + 1 - min) * Math.random() + min;
        return Math.floor(r);
      }
      function shuffle(arr = []) {
        for (let i = 0; i < arr.length; i++) {
          if (i === arr.length - 1) break;
          const x = random(i + 1, arr.length - 1);
          let t = arr[i];
          arr[i] = arr[x];
          arr[x] = t;
        }
        console.log(arr);
      }
      shuffle(nums);
    </script>
  </body>
</html>
